import requestApi from "../utils/request"

// 用户验证
export async function validateUser(username, password) {
  return await requestApi('/login', {
    method: 'post',
    data: {
      accountNumber: username,
      password
    }
  })
}

// 获取历史记录
export async function getHistory(type, page = 1, pageSize = 20) {
  return await requestApi('/getLotteryHistory', {
    method: 'post',
    data: {
      type,
      page,
      pageSize
    }
  })
}

// 获取统计数据
export async function getStatistics(type) {
  return await requestApi('/getStatistics', {
    method: 'post',
    data: { type }
  })
}

export async function generateRandomNumbers(data) {
  return await requestApi('/generateRandomNumbers', {
    method: 'post',
    data: data
  })
}

export async function getAllTypes(data) {
  return await requestApi('/getAllTypes', {
    method: 'post',
    data: data
  })
}